1. Field of the Invention
The present invention relates to an electronic apparatus and, more particularly, to a technique of protecting programs and shortening the activation time when a non-volatile memory is used as a main memory.
2. Description of the Related Art
Conventionally, in an electronic apparatus such as a digital camera, a volatile memory such as a DRAM is used as a main memory for image processing and the like. There is also proposed an arrangement in which a non-volatile memory is used as a main memory, instead of a volatile memory (for example, Japanese Patent Laid-Open No. 2004-334626).
In an electronic apparatus, there is known a method of executing a program by storing a program code and data in a non-volatile memory such as a NOR flash memory, copying the program code and data from the non-volatile memory to a volatile memory such as a DRAM whose access speed is higher before executing the program, and accessing the volatile memory.
Furthermore, in recent years, non-volatile memories, with access speeds and rewrite counts as high as the DRAM, such as MRAMs (Magnetoresistive Random Access Memory) have made their debut. This allows a single device to store a program code and provide a work region.
In an electronic apparatus including a NOR flash memory and DRAM, however, it takes time to copy a program code and data due to a problem associated with the access speed of the NOR flash memory.
A non-volatile main memory such as an MRAM can readily perform a write operation via the memory controller of the electronic apparatus, as compared with the NOR flash memory. If, therefore, the non-volatile main memory such as an MRAM stores program codes in advance, programs including a boot program may be corrupted when, for example, a program goes out of control.